package com.gitee.cirnochat.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;

import java.time.Duration;

/**
 * Jwt配置
 * @author FlanChan
 */
@Data
@ConfigurationProperties(prefix = "cirno.jwt")
public class JwtProperties {
    /**
     * jwt token 存储位置
     */
    private Resource location;
    /**
     * jwt token 密钥
     */
    private String password;
    /**
     * jwt token 签名算法
     */
    private String alias;

    /**
     * access_token 过期时间
     * 默认30分钟
     */
    private Duration accessTokenTTL = Duration.ofDays(7);

    /**
     * refresh_token 过期时间
     * 默认7天
     */
    private Duration refreshTokenTTL = Duration.ofDays(30);
}
